/*
 * BaseEmHelper.java
 *
 * Created on November 7, 2007, 4:43 PM
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package com.computec.baseem.helper;

import com.computec.baseem.base.helper.BaseHelper;
import com.computec.baseem.constantes.ConstantesGenerales;

import com.src.computec.radar.services.utilities.dao.BaseBaseEmDAO;
import com.src.computec.radar.services.utilities.dao.BaseEmDao;
import com.src.computec.radar.services.utilities.dto.BaseExcelDto;
import com.computec.baseem.exception.BaseEmException;
import com.src.computec.radar.base.dao.exception.DAOException;
import com.src.computec.radar.base.source.CoreSource;
import com.src.computec.radar.base.util.RandomStringUtils;
import com.src.computec.radar.services.utilities.dao.BaseClienteDAO;
import com.src.computec.radar.services.utilities.dao.BaseNodoDAO;
import com.src.computec.radar.services.utilities.dao.BaseProveedorDAO;
import com.src.computec.radar.services.utilities.dao.ClienteDAO;
import com.src.computec.radar.services.utilities.dao.NodoDAO;
import com.src.computec.radar.services.utilities.dao.ProveedorDAO;
import com.src.computec.radar.services.utilities.dto.ClienteDto;
import com.src.computec.radar.services.utilities.dto.NodoDto;
import com.src.computec.radar.services.utilities.dto.ProveedorDto;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import com.src.computec.radar.services.utilities.zip.CreateZipFile;

/**
 *
 * @author fsanchez
 */
public class BaseEmHelper extends BaseHelper{
    
    /** Creates a new instance of BaseEmHelper */
    public BaseEmHelper() {
    }
    
    
     /**
     * Retorna una Lista de clientes tabla CLIENTES
     * @return Lista de ClienteDto
     * @throws com.src.computec.radar.base.dao.exception.DAOException 
     */
     public List getClientes() throws BaseEmException{
	BaseClienteDAO dao = (ClienteDAO) this.getFactoryDAO().getClienteDAO();
        try {
            return dao.getClientes();
        }
        catch (DAOException e) {
            throw new BaseEmException("BaseEmHelper:getClientes: " + e.toString());
        }   
    }
     
     /**
     * Retorna una Lista de Nodos por Proveedor
     * @return Lista de NodoDto
     * @throws com.src.computec.radar.base.dao.exception.DAOException 
     */
     public List NodosByProveedor(ProveedorDto pDto) throws BaseEmException{
	BaseNodoDAO dao = (NodoDAO) this.getFactoryDAO().getNodoDAO();
        try {
            return dao.getNodosByProveedor(pDto);
        }
        catch (DAOException e) {
            throw new BaseEmException("BaseEmHelper:getClientes: " + e.toString());
        }   
    }
     /**
     * Retorna una Lista de Proveedores
     * @return Lista de ProveedorDto
     * @throws com.src.computec.radar.base.dao.exception.DAOException 
     */
     public List getProveedoresEmpresaMensajeria() throws BaseEmException{
	BaseProveedorDAO dao = (ProveedorDAO) this.getFactoryDAO().getProveedorDAO();
	try {
	    return dao.getProveedoresEmpresaMensajeria();
	}
	catch (DAOException e) {
	    throw new BaseEmException("BaseEmHelper:proveedorList: " + e.toString());
	}   
      }
      public List getListadoBases(ProveedorDto proDto,NodoDto nodoDto,ClienteDto cliDto,Date pFechaIni,Date pFechaFin,String pNumeroOrden) throws BaseEmException{
	  BaseBaseEmDAO dao = (BaseBaseEmDAO) this.getFactoryDAO().getBaseEmDAO();	  
	  try{	      
	      return dao.getListadoBases(proDto, nodoDto, cliDto, pFechaIni, pFechaFin, pNumeroOrden);
	      
	  }catch(DAOException e){
	      throw new BaseEmException("BaseEmHelper:getListadoBases: " + e.toString());
	  }
      }
      
      
      public List getInfoDescargas(String pCodigoBase) throws BaseEmException{
	   BaseBaseEmDAO dao = (BaseBaseEmDAO) this.getFactoryDAO().getBaseEmDAO();
	  try{
	      return dao.getInfoDescargas(pCodigoBase);
	  }catch(DAOException e){
	      throw new BaseEmException("BaseEmHelper:getInfoDescargas: " + e.toString());
	  }
      }
      
 
   
}
